home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / greps.zip / MAKEFILE.IN < prev    next >
Text File  |  1993-09-17  |  4KB  |  135 lines

  1. # Makefile for GNU e?grep
  2. # Copyright (C) 1992 Free Software Foundation, Inc.
  3.  
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8.  
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. SHELL = /bin/sh
  19.  
  20. #### Start of system configuration section. ####
  21.  
  22. srcdir = @srcdir@
  23. @VPATH@
  24.  
  25. CC = @CC@
  26.  
  27. INSTALL = @INSTALL@
  28. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  29. INSTALL_DATA = @INSTALL_DATA@
  30.  
  31. # Things you might add to DEFS:
  32. # -DSTDC_HEADERS    If you have ANSI C headers and libraries.
  33. # -DHAVE_UNISTD_H    If you have unistd.h.
  34. # -DUSG            If you have System V/ANSI C string
  35. #            and memory functions and headers.
  36. # -D__CHAR_UNSIGNED__    If type `char' is unsigned.
  37. #            gcc defines this automatically.
  38.  
  39. DEFS = @DEFS@
  40.  
  41. # Any libraries that are needed, such as to get alloca.
  42. LIBS = @LIBS@
  43.  
  44. CDEBUG = -g
  45. CFLAGS = $(CDEBUG) -I$(srcdir) $(DEFS)
  46. LDFLAGS = -g
  47.  
  48. prefix = /usr/local
  49. exec_prefix = $(prefix)
  50.  
  51. # Prefix for installed program, normally empty or `g'.
  52. binprefix = 
  53. # Prefix for installed man page, normally empty or `g'.
  54. manprefix = 
  55.  
  56. # Where to install executables.
  57. bindir = $(exec_prefix)/bin
  58.  
  59. # Where to put Unix-style manual pages.
  60. mandir = $(prefix)/man/man1
  61. # Extension (not including `.') for the Unix-style manual page filenames.
  62. manext = 1
  63.  
  64. #### End of system configuration section. ####
  65.  
  66. MISC = README INSTALL grep.man COPYING Makefile.in configure configure.in \
  67.  README.cray README.sunos4
  68. SRCS = grep.c dfa.c regex.c getopt.c alloca.c
  69. HDRS = dfa.h getopt.h regex.h
  70. DISTFILES = $(MISC) $(SRCS) $(HDRS)
  71. TESTFILES = khadafy.lines khadafy.regexp regress.sh scriptgen.awk spencer.tests
  72.  
  73. OBJS = dfa.o regex.o getopt.o @ALLOCA@
  74. GOBJ = ggrep.o
  75. EOBJ = egrep.o
  76.  
  77. all: grep egrep check.done
  78.  
  79. install: all
  80.     $(INSTALL_PROGRAM) grep $(bindir)/$(binprefix)grep
  81.     $(INSTALL_PROGRAM) egrep $(bindir)/$(binprefix)egrep
  82.     -$(INSTALL_DATA) $(srcdir)/grep.man $(mandir)/$(manprefix)grep.$(manext)
  83.  
  84. check:
  85.     builddir=`pwd`; cd $(srcdir)/tests; sh regress.sh $$builddir
  86.     touch check.done
  87.  
  88. check.done: grep egrep
  89.     builddir=`pwd`; cd $(srcdir)/tests; sh regress.sh $$builddir
  90.     touch check.done
  91.  
  92. grep: $(OBJS) $(GOBJ)
  93.     $(CC) $(LDFLAGS) -o $@ $(OBJS) $(GOBJ) $(LIBS)
  94.  
  95. egrep: $(OBJS) $(EOBJ)
  96.     $(CC) $(LDFLAGS) -o $@ $(OBJS) $(EOBJ) $(LIBS)
  97.  
  98. ggrep.o: grep.c
  99.     $(CC) $(CFLAGS) -c $(srcdir)/grep.c
  100.     mv grep.o ggrep.o
  101.  
  102. egrep.o: grep.c
  103.     $(CC) $(CFLAGS) -DEGREP -c $(srcdir)/grep.c
  104.     mv grep.o egrep.o
  105.  
  106. TAGS: $(SRCS)
  107.     etags $(SRCS)
  108.  
  109. clean:
  110.     rm -f grep egrep check.done *.o core tests/core tests/tmp.script \
  111.     tests/khadafy.out
  112.  
  113. mostlyclean: clean
  114.  
  115. distclean: clean
  116.     rm -f Makefile config.status
  117.  
  118. realclean: distclean
  119.     rm -f TAGS
  120.  
  121. dfa.o egrep.o ggrep.o: dfa.h
  122. egrep.o ggrep.o regex.o: regex.h
  123. egrep.o ggrep.o: getopt.h
  124. regex.o: regex.c regex.h
  125. getopt.o: getopt.h
  126.  
  127. dist:
  128.     echo grep-`sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9a-zA-Z.]*\).*/\1/' -e q < grep.c` > .fname
  129.     rm -rf `cat .fname`
  130.     mkdir `cat .fname`  `cat .fname`/tests
  131.     ln $(DISTFILES) `cat .fname`
  132.     cd tests; ln $(TESTFILES) ../`cat ../.fname`/tests
  133.     tar chZf `cat .fname`.tar.Z `cat .fname`
  134.     rm -rf `cat .fname` .fname
  135.